package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.ITSMApproveDTO;
import com.neusoft.neuiotms.dcam.workflow.model.ITSMApprove;

@Component
public class ITSMApproveConverter extends AbstractConverter<ITSMApprove, ITSMApproveDTO> {

    @Override
    public ITSMApprove toModel(final ITSMApproveDTO dto) {
        final ITSMApprove model = new ITSMApprove();
        model.setWorkOrderNum(dto.getWorkOrderNum());
        model.setTaskId(dto.getTaskId());
        model.setResult(dto.getResult());
        return model;
    }

    @Override
    public ITSMApproveDTO toDTO(final ITSMApprove model, final boolean forListView) {
        final ITSMApproveDTO dto = new ITSMApproveDTO();
        dto.setId(model.getId());
        dto.setWorkOrderNum(model.getWorkOrderNum());
        dto.setTaskId(model.getTaskId());
        dto.setResult(model.getResult());
        return dto;
    }

}
